<template>

  <el-form
      ref="ruleFormRef"
      status-icon
      label-width="120px"
      class="demo-ruleForm"
  >

    <el-form-item label="User" prop="pass">
      <el-input v-model="user.username"  />
    </el-form-item>

    <el-form-item label="Password" prop="pass">
      <el-input v-model="user.password" type="password" autocomplete="off"/>
    </el-form-item>


    <el-form-item>
      <el-button type="primary" @click="login"
      >登录
      </el-button
      >
      <el-button @click="register">注册</el-button>
    </el-form-item>

  </el-form>

</template>

<script setup>
import {ref} from 'vue'
import {useRouter} from 'vue-router'
import {ElMessage} from "element-plus";

const router = useRouter();

const user = ref({
  username: '',
  password: '',
})


let register = () => {
  router.push('/register');
}

let login = () => {
  ElMessage({
    message: '登录成功',
    type: 'success',
  })
}


</script>

<style scoped>

</style>